package day240519;

public class Test2 {
    public static void main(String[] args) {


        int max = 100;
        System.out.println("1到" + max + "之间的质数有：");
        for (int i = 2; i <= max; i++) {
            if (isPrime(i)) {
                System.out.print(i + " ");
            }
        }
    }

        public static boolean isPrime(int num){
            for (int i = 2; i <= num / 2; i++) {
                if (num % i == 0) {
                    return false;
                }
            }
            return true;
        }
    }
